/**
 * 
 */
package com.cdhospital.adminservice;

import com.cdhospital.Model.News;
import com.jfinal.plugin.activerecord.Page;


/**
 * @author 17994
 *
 */
public class NewsService {
	private static final News dao=new News().dao();
	
	public Page<News> paginate(int pageNumber, int pageSize,int status) {
		
		return dao.paginate(pageNumber, pageSize, "select *", "from  news where status=? order by createtime desc ",status);
	}
	public  boolean deleteById(int id) {
		boolean flag=dao.deleteById(id);
		return flag;
	}
	public News findById(int id) {
		return dao.findById(id);
	}
	public Page<News>  paginates(Integer pageNumber, int pageSize, String title,int status) {
		return dao.paginate(pageNumber, pageSize, "select *", "from news where status=? title like ? ",status,title);
	}
	
}
